A blockchain may be used as a public ledger (or private ledger) to store information within a database. Transactions are executed within a blockchain database when it is determined that certain conditions are satisfied. The results of the transaction mutate the information stored in the database which is replicated (i.e., distributed) across multiple blockchain nodes. Because any individual or entity can provide information to a public blockchain, this information should be reviewed and confirmed. This review operation is known as consensus. Blockchain systems typically rely on a decentralized consensus which transfers authority and trust to a decentralized network and enables its nodes (i.e., blockchain peers) to continuously and sequentially record their transactions on a public “block”, creating a unique “chain” referred to as a blockchain. Cryptography, via hash codes, is used with a blockchain to secure an authentication of a transaction source and removes the need for a central intermediary.
A blockchain transaction relies on optimistic concurrency control for processing a blockchain transaction. The process typically has three phases including a read phase in which data is collected from the database and written to a private workspace, a validation phase in which the read data is checked for conflict with other transactions, and a write phase in which the data written to the private workspace is committed to the blockchain after a successful validation. However, in a distributed database such as blockchain, there is a delay between when a transaction performs a read phase to when the read/modified data is committed to the database for public view. As a result, new data items are often added or removed from the database after data has been read for transaction processing but prior to the processed data committed to the blockchain database. This delay can give rise to phantom reads/phantom items which result in data items being added and/or deleted from the database by other transactions while a first transaction is being processed between the read phase and the commit process. Phantom items create inconsistencies and inaccuracies within the blockchain database leading to errors and other faulty conditions.